package assem;
import temp.Temp;
import temp.TempMap;
import util.List;

public class MOVE extends Instr {
    public MOVE(String a, Temp d, Temp s) {
        assem = a;
        use = new List<Temp>(s,null);
        def = new List<Temp>(d,null);
        jumps = null;
    }
    public Temp dst() throws Exception { return def.get(0); }
    public Temp src() throws Exception { return use.get(0); }

    public String format(TempMap m) throws Exception {
        if (m.tempMap(src()) == m.tempMap(dst()))
                    return "#" + super.format(m);
        
        return super.format(m);
    }
}
